<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://unpkg.com/vue"></script>
</head>
<body>
<div id="app">
   输入一个数字：<input type="text" v-model="value">
    <p>计算结果：{{square}}</p>
</div>
<script>
  var V=new Vue({
      el:'#app',
      data:{
          value:''
      },
      computed:{
          square:function(){
              return this.value*this.value;
          }
      }
  })
</script>
</body>
</html>